# Default values for build configurations
################################################################################
-# The Target build architecture.
+# The Target build architecture. Supported values are: aarch64, aarch32.
ARCH := aarch64
# Build verbosity
V := 0
PLAT := ${DEFAULT_PLAT}
# SPD choice
SPD := none
+# The AArch32 Secure Payload to be built as BL32 image
+AARCH32_SP := none
# Base commit to perform code check on
BASE_COMMIT := origin/master
# NS timer register save and restore
NM := ${CROSS_COMPILE}nm
PP := ${CROSS_COMPILE}gcc -E
+ASFLAGS_aarch64 = -mgeneral-regs-only
+TF_CFLAGS_aarch64 = -mgeneral-regs-only -mstrict-align
+
+ASFLAGS_aarch32 = -march=armv8-a
+TF_CFLAGS_aarch32 = -march=armv8-a
+
ASFLAGS += -nostdinc -ffreestanding -Wa,--fatal-warnings \
-Werror -Wmissing-include-dirs \
- -mgeneral-regs-only -D__ASSEMBLY__ \
+ -D__ASSEMBLY__ $(ASFLAGS_$(ARCH)) \
${DEFINES} ${INCLUDES}
TF_CFLAGS += -nostdinc -ffreestanding -Wall \
-Werror -Wmissing-include-dirs \
- -mgeneral-regs-only -mstrict-align \
-std=c99 -c -Os \
+ $(TF_CFLAGS_$(ARCH)) \
${DEFINES} ${INCLUDES}
TF_CFLAGS += -ffunction-sections -fdata-sections
BL_COMMON_SOURCES += common/bl_common.c \
common/tf_printf.c \
- common/aarch64/debug.S \
- lib/aarch64/cache_helpers.S \
- lib/aarch64/misc_helpers.S \
- plat/common/aarch64/platform_helpers.S \
+ common/${ARCH}/debug.S \
+ lib/${ARCH}/cache_helpers.S \
+ lib/${ARCH}/misc_helpers.S \
+ plat/common/${ARCH}/platform_helpers.S \
${STDLIB_SRCS}
INCLUDES += -Iinclude/bl1 \
-Iinclude/bl31 \
-Iinclude/common \
- -Iinclude/common/aarch64 \
+ -Iinclude/common/${ARCH} \
-Iinclude/drivers \
-Iinclude/drivers/arm \
-Iinclude/drivers/auth \
-Iinclude/drivers/io \
-Iinclude/drivers/ti/uart \
-Iinclude/lib \
- -Iinclude/lib/aarch64 \
- -Iinclude/lib/cpus/aarch64 \
+ -Iinclude/lib/${ARCH} \
+ -Iinclude/lib/cpus/${ARCH} \
-Iinclude/lib/el3_runtime \
- -Iinclude/lib/el3_runtime/aarch64 \
+ -Iinclude/lib/el3_runtime/${ARCH} \
-Iinclude/lib/psci \
-Iinclude/plat/common \
-Iinclude/services \
################################################################################
ifneq (${SPD},none)
+ifeq (${ARCH},aarch32)
+ $(error "Error: SPD is incompatible with AArch32.")
+endif
ifdef EL3_PAYLOAD_BASE
$(warning "SPD and EL3_PAYLOAD_BASE are incompatible build options.")
$(warning "The SPD and its BL32 companion will be present but ignored.")
include ${PLAT_MAKEFILE_FULL}
+# Platform compatibility is not supported in AArch32
+ifneq (${ARCH},aarch32)
# If the platform has not defined ENABLE_PLAT_COMPAT, then enable it by default
ifndef ENABLE_PLAT_COMPAT
ENABLE_PLAT_COMPAT := 1
ifneq (${ENABLE_PLAT_COMPAT}, 0)
include plat/compat/plat_compat.mk
endif
+endif
# Include the CPU specific operations makefile, which provides default
# values for all CPU errata workarounds and CPU specific optimisations.
################################################################################
# Include BL specific makefiles
################################################################################
-
+# BL31 is not needed and BL1, BL2 & BL2U are not currently supported in AArch32
+ifneq (${ARCH},aarch32)
ifdef BL1_SOURCES
NEED_BL1 := yes
include bl1/bl1.mk
include bl31/bl31.mk
endif
endif
+endif
+
+ifeq (${ARCH},aarch32)
+NEED_BL32 := yes
+################################################################################
+# Build `AARCH32_SP` as BL32 image for AArch32
+################################################################################
+ifneq (${AARCH32_SP},none)
+# We expect to locate an sp.mk under the specified AARCH32_SP directory
+AARCH32_SP_MAKE := $(wildcard bl32/${AARCH32_SP}/${AARCH32_SP}.mk)
+
+ifeq (${AARCH32_SP_MAKE},)
+ $(error Error: No bl32/${AARCH32_SP}/${AARCH32_SP}.mk located)
+endif
+
+$(info Including ${AARCH32_SP_MAKE})
+include ${AARCH32_SP_MAKE}
+endif
+
+endif
################################################################################
# Build targets
@echo " bl2 Build the BL2 binary"
@echo " bl2u Build the BL2U binary"
@echo " bl31 Build the BL31 binary"
- @echo " bl32 Build the BL32 binary"
+ @echo " bl32 Build the BL32 binary. If ARCH=aarch32, then "
+ @echo " this builds secure payload specified by AARCH32_SP"
@echo " certificates Build the certificates (requires 'GENERATE_COT=1')"
@echo " fip Build the Firmware Image Package (FIP)"
@echo " fwu_fip Build the FWU Firmware Image Package (FIP)"
platform name must be subdirectory of any depth under `plat/`, and must
contain a platform makefile named `platform.mk`.
+* `ARCH` : Choose the target build architecture for ARM Trusted Firmware.
+ It can take either `aarch64` or `aarch32` as values. By default, it is
+ defined to `aarch64`.
+
* `SPD`: Choose a Secure Payload Dispatcher component to be built into the
- Trusted Firmware. The value should be the path to the directory containing
- the SPD source, relative to `services/spd/`; the directory is expected to
+ Trusted Firmware. This build option is only valid if `ARCH=aarch64`. The
+ value should be the path to the directory containing the SPD source,
+ relative to `services/spd/`; the directory is expected to
contain a makefile called `<spd-value>.mk`.
+* `AARCH32_SP` : Choose the AArch32 Secure Payload component to be built as
+ as the BL32 image when `ARCH=aarch32`. The value should be the path to the
+ directory containing the SP source, relative to the `bl32/`; the directory
+ is expected to contain a makefile called `<aarch32_sp-value>.mk`.
+
* `V`: Verbose build. If assigned anything other than 0, the build commands
are printed. Default is 0.